Repository navigation
Conversation
Opening a thread to glance at it marks it read, so a thread you meant to come back to disappears from the unread set. The new general setting markThreadsReadOnView (default true, no behavior change) lets users keep threads unread until they mark them read or reply. The app does not auto-mark threads read until system config has loaded, so a cold start straight into a thread cannot read it before the setting is known. The plugin SDK version is bumped because AppSettings is part of the bundled types.
2 tasks done
Contributor
|
Thanks for the pull request, @kolsha. It was closed automatically because it does not meet the requirements below yet. This is an automated check, not a review of the change. Contributor approval. bb reviews pull requests only from approved contributors, and you are not on the list yet. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ), post a link to your pull request, and explain what it changes and why. A maintainer then adds you to the list and reopens the pull request. See CONTRIBUTING.md for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
The app marks a thread read whenever it is visible and the user is active, and marks it read again whenever new replies arrive while it is on screen (
useThreadReadTracking). No setting turns this off. So a user who glances at a thread, decides to come back to it later, and leaves loses it from the unread set. A plugin can't fix this cleanly:experimental_thread.readfires after the read is written and doesn't say what caused it (see #8341).What changed
packages/domain/src/app-settings.ts: new general settingmarkThreadsReadOnView, defaulttrue, so nothing changes for anyone else. It is optional in updates, andapps/server/src/routes/system.tskeeps the saved value when an older client omits it, as Add a setting to turn off shell command summaries #5567 does forsummarizeShellCommands.apps/app/src/hooks/useThreadReadTracking.ts: newmarkOnViewparameter. When it is false, the hook acts as if no thread were shown, using the existingthread: undefinedgating. When it turns on while a thread is open, that thread is treated as freshly opened and marked read.useMarkThreadsReadOnView()insystem-queries.tsreturnsgeneralSettings.markThreadsReadOnView === true. While system config is still loading this is false, so a cold start straight into a thread never marks it read before the setting is known. This followsThreadTerminalView'sterminalCopyOnSelect === true. Both callers use it:useThreadDetailThreadandPluginThreadChat.thread.markReadshortcut,bb thread read,sdk.threads.markRead) or when the user sends it a turn (server behavior, unchanged).SettingsView.tsx: a switch in Settings → General → Threads & editing. The CLI (bb settings general markThreadsReadOnView false) andsdk.system.updateGeneralSettingswork through the existing schema-driven paths.docs/configuration.mdandbb guide customization.AppSettingsis part of the bundled types (the npm version guard failed without it).How you verified
useThreadReadTracking.test.tsx: withmarkOnView: false, a viewed thread stays unread across a visibility change, new attention, and user input. TurningmarkOnViewon while the thread is open marks it read once. Both fail without themarkOnViewgate.apps/server/test/system/general-settings.test.ts:markThreadsReadOnViewadded to the check that an opt-out survives saves from older clients (ran with-t markThreadsReadOnViewto confirm the case was selected).thread-opening.model.test.tsxcovers auto-read on open, so it now stubsuseMarkThreadsReadOnViewtotrue.b0ddaad731:pnpm exec turbo run typecheckfor@bb/domain,@bb/db,@bb/server,@bb/app,@bb/cli,@bb/mobile,@bb/sdk,@bb/demo-server,@bb/provider-parity,@bb/client-core: 16/16 passed.turbo run testfor@bb/app,@bb/db,@bb/domain,@bb/templates.@bb/app: 7484 passed, 1 failed. The failure wasPluginIcon.test.tsxreading a leftover localplugins/connect-next/directory (only an orphanednode_modules). After removing that directory it passes; it is unrelated to this change.general-settings.test.ts(14 passed) and CLIsettings.test.ts(23 passed).turbo run lint --filter=@bb/app: 0 errors, no warnings in changed files.packages/plugin-sdk/scripts/check-npm-version-guard.mjs: PASS for 0.6.206.pnpm dev, before the rebase (on88cf8f644c), using headless Chrome via Playwright against the dev app:/threads/<id>), saw the reply rendered, pressed a key and moved the mouse.lastReadAtstayed belowlatestAttentionAt(still unread).lastReadAtupdated).markThreadsReadOnView: falseon the server (checked withGET /api/v1/system/config).Fixes #8341